<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  <title>首页</title>
  <style>
    * {
        margin: 0;
        padding: 0;
    }
    html {
        height: 100%;
    }
    body {
        height: 100%;
        margin: 0;
        padding: 0;
    }
    table {
        border-collapse: collapse;
        text-align: center;
    }
    table td {
        border:1px solid black;
    }
    .head {
        height:20%;
        //background: url(/trm/img/index.jpg);
        background: #1E90FF;
    }
    .systemName {
        color: yellow;
        font-size: 25px;
        padding: 10px 0 0 10px;
        //text-align: center;
    }
    .user {
        padding:20px;
        text-align:right;
        color: white;
    }
    .left {
        width: 100%;
        text-align: center;
        background: #C6E2FF;
        height: 80%;
        float: left;
    }
    li {
        height: 40px;
        line-height: 40px;
        cursor: pointer;
        font-size: 20px;
    }
    li:hover {
        background: #7AC5CD;
    }
    .manager {
        display: none;
    }
  </style>
  <script>
    function userInfo() {
        window.location.href = "StudentServlet?action=edit&role=${user.role}&id=${user.id}&type=self";
    }
    function userList(role) {
    	window.location.href = "StudentServlet?role=" + role;
    }
    function manager() {
    	window.location.href = "manager/manager.jsp";
    }
    function modifyPassword() {
    	window.location.href = "UserServlet?action=modifyPassword";
    }
  </script>
</head>
<body>
  <div class="head">
    <div class="systemName">trm</div>
    <div class="user">欢迎，${user.name} &nbsp;&nbsp;<a style="color:white;" href="LoginServlet?action=exit">退出</a></div>
  </div>
  <div class="left">
    <ul>
      <!-- <li onclick="modifyPassword();"><a>修改密码</a></li> -->
      <li onclick="userInfo();"><a>个人信息</a></li>
      <c:forEach var="role" items="${list}">
        <li onclick="userList(${role.id});"><a>${role.role}信息</a></li>
      </c:forEach>
      <li onclick="manager();"><a>系统管理</a></li>
    </ul>
  </div>
</body>
</html>